{{include template('public/header','home')}}

<div class="row {{$template}}  {{$catinfo['arrchildid']}}" style="margin-top: 10px;" id="{{$catid}}">
    <div class="col-md-8">
        <ul id="breadcrumb" name="breadcrumb" class="breadcrumb mavbar-breadcrumb">
            <li><a href="/"><i class="fa fa-home fa-fw"></i>首页</a></li>
            <li><a href="{{url('index')}}" title="">{{$modelinfo['name']}}</a></li>
        </ul>
        <div class="content">
            <form action="{{url('index/post')}}" method="post" onsubmit="return checkall()">
                <input type="hidden" name="modelid" value="{{$modelid}}">
                <table class="table table-border ticky_table">
                    {{foreach $fieldstr as $val}}
                    <tr>{{$val}}</tr>
                    {{/foreach}}
                    {{if $modelinfo['check_code']}}
                    <tr>
                        <td>验证码<span class="red">*</span></td>
                        <td><input name="code" type="text" class="input_text" style="width:100px;margin:5px 10px 10px 0;"><img src="{U('api/index/code')}" onclick="this.src = this.src + '?'" style="cursor:pointer;" title="看不清？点击更换"></td>
                    </tr>
                    {{/if}}
                    <tr><td></td>
                        <td><input type="submit" name="dosubmit" value="提 交" class="btn btn-primary" ></td>
                    </tr>
                </table>
            </form>
        </div>

    </div>
    <div class="col-md-4">
        {{include template('public/main_right','home')}}
    </div>
</div>
<script type="text/javascript">
    function checkall() {
    //form必填字段的验证
    {{foreach $field_check as  $k => $v}}
    {{if $v['isrequired'] && in_array($v['fieldtype'], array('input', 'textarea'))}}
    if ($("{{$v[fieldtype]}}[name='{{$k}}']").val() == ''){
    layer.alert("{{$v[errortips]}}");
    return false;
    }
    {{/if}}
    {{/foreach}}
            //验证码的验证
            if ($("input[name='code']").val() == '') {
    layer.alert("验证码不能为空!");
    return false;
    }
    return true;
    }
</script>
{{include template('public/footer','home')}}

